package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 采购订单来源 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum PayWayEnum {
    // 结算方式(1现结-验收前；2现结-验收后；3账期-月付；4账期-季付；5账期-半年付；6账期-年付；7背靠背；8灵活用工
    YSQ(1,"019-0179eb8f98e10002"),
    YSH(2,"019-017af221dd780004"),
    YF(3,"019-01784e3fa1180040"),
    JF(4,"019-01784e3fdf650041"),
    BNF(5,"019-01784e40045e0042"),
    NF(6,"019-01784e401b7a0043"),
    BKB(7,"019-01784e402d820044"),
    LHYG(8,"019-017baad282f8005c");



    private Integer key;
    private String value;

    PayWayEnum(Integer key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static PayWayEnum getValue(Integer key){

        for (PayWayEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }
}
